package com.yxw.spring6.aop;

public class CalculatorStaticProxy implements Calculator{

    private Calculator calculator;

    public CalculatorStaticProxy(Calculator calculator) {
        this.calculator = calculator;
    }

    @Override
    public int add(int i, int j) {
        System.out.println("[日志] add 方法开始了，参数是：" + i + "," + j);
        int addResult = calculator.add(i, j);
        System.out.println("[日志] add 方法结束了，结果是：" + addResult);
        return addResult;
    }

    @Override
    public int sub(int i, int j) {
        return 0;
    }

    @Override
    public int mul(int i, int j) {
        return 0;
    }

    @Override
    public int div(int i, int j) {
        return 0;
    }

    public static void main(String[] args) {
        CalculatorStaticProxy staticProxy = new CalculatorStaticProxy(new CalculatorImpl());
        staticProxy.add(1,2);

    }
}
